package com.cxs.enums;

import lombok.Getter;
import lombok.Setter;

/**
 * @ClassName: OpenTypeEnum
 * @description:
 * @author: 诗涵
 * @create: 2024-01-07 08:17
 */
public enum OpenTypeEnum {
    EVERY_OPEN(0, "每天开放"),
    WORK_DAY_OPEN(1, "工作日开放"),
    REST_DAY_OPEN(2, "休息日开放"),
    ;

    @Setter
    @Getter
    private Integer type;

    @Setter
    @Getter
    private String desc;

    OpenTypeEnum(Integer type, String desc) {
        this.type = type;
        this.desc = desc;
    }


    public static String getDesc(Integer type){
        if (null == type) {
            return "";
        }

        OpenTypeEnum[] values = OpenTypeEnum.values();

        for (OpenTypeEnum value : values) {
            if (value.getType().equals(type)) {
                return value.getDesc();
            }
        }
        return "";
    }
}
